var paste={    
    methods:{
        cmd_paste_do:function(){
            if(!this.cmd_copy_elements) return;          
            var elements = JSON.parse(this.cmd_copy_elements);
            if(!elements || elements.length <= 0) return;            
            var copyReplace=[]; 
            this.cmdo('records');                         
            elements.forEach(element => {
                var its = this.items.filter(e=>e.type === element.type)[0];
                if(its.methods[`pasteXY`]){
                    its.methods[`pasteXY`](element);
                }else{
                    this._pasteXY(element);
                }          
                // console.log('paste after:',JSON.parse(JSON.stringify(element)));      
                this.itemsInstanceUnChkSel(this.activePageIndex);
                copyReplace.push(this.renderItem(this.pages[this.activePageIndex],element));               
            });
            this.itemsInstanceSelected(copyReplace);
            this.cmd_copy_elements=JSON.stringify(copyReplace);
             
        }
    }
}

export default paste;
